#include <iostream>
#include <thread>
#include "threads.h"

using namespace std;

int main(int argc, char** argv) {
    int receivePort = 26540;
    int sendPort = 24580;
    char* ipAddr = "127.0.0.1";//目标IP地址
    thread udp_recv_thread(udp_receive, ipAddr, receivePort);
    thread udp_send_thread(udp_send, ipAddr, sendPort);
    thread mavlink_send_thread(mavlink_send, ipAddr, sendPort);
    thread mavlink_recv_thread(mavlink_receive, ipAddr, receivePort);

    udp_recv_thread.join();
    udp_send_thread.join();
    mavlink_send_thread.join();
    mavlink_recv_thread.join();
    return 0;
}


